package com.cskaoyan.controller.wx_collect_controller;

import com.cskaoyan.bean.BaseRespVo;
import com.cskaoyan.bean.vo.promotion_vo.BaseRespWithoutDataVO;
import com.cskaoyan.bean.wx_bo.AddOrDeleteWxCollectBO;
import com.cskaoyan.bean.wx_vo.collect.ListWxCollectionVO;
import com.cskaoyan.service.wx_collect_service.WxCollectService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @description：
 * @author: 曹旭
 * @date: 2022/5/9 17:21
 */
@RestController
@RequestMapping("wx/collect")
public class WxCollectController {

    @Autowired
    WxCollectService wxCollectService;

    //  type=0&page=1&limit=10
    @RequestMapping("list")
    public BaseRespVo list(Byte type, Integer page, Integer limit) {
        ListWxCollectionVO listWxCollectionVO = this.wxCollectService.list(type, page, limit);
        return BaseRespVo.ok(listWxCollectionVO);
    }

    @RequestMapping("addordelete")
    public BaseRespWithoutDataVO addOrDelete(@RequestBody AddOrDeleteWxCollectBO addOrDeleteWxCollectBO) {
        this.wxCollectService.addOrDelete(addOrDeleteWxCollectBO);
        return BaseRespWithoutDataVO.ok();
    }
}

